home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGIALS / ADATUTR.LZH / INSTALL.EXE / TOMORROW.ANS (.png) < prev    next >
ANSI Art File  |  1991-03-25  |  846b  |  640x320  |  1-bit (2 colors)
Labels: text | screenshot | font
OCR: Our solution to Outside Assignment 3: separate (NEXTDATE) function TOMORROW ( TODAY : in DATE) return DATE is LENGTH : array (MONTH_TYPE) of DAY_SUBTYPE := (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); ANSWER : DATE; begin if TODAY. YEAR mod 4 = 0 and (TODAY. YEAR mod 100 /= 0 or TODAY . YEAR mod 400 = 0) then LENGTH (FEB) := 29; end if ; if TODAY. DAY /= LENGTH ( TODAY. MONTH) then -- Not end of month. ANSWER := (TODAY. DAY + 1, TODAY. MONTH, TODAY. YEAR); elsif TODAY. MONTH /= DEC then End of month, but not end of year. ANSWER := (1, MONTH_TYPE' SUCC(TODAY. MONTH), TODAY . YEAR) ; else -- End of year . ANSWER := (1, JAN, TODAY . YEAR + 1); end if ; return ANSWER; end TOMORROW;